<template>
  <div class="cart">
    <nav-bar class="cart-nav-bar">
      <template #center><div>购物车({{cartLength}})</div></template>
    </nav-bar>
    <cart-list></cart-list>
    <cart-bottom-bar></cart-bottom-bar>
  </div>
</template>

<script>
import NavBar from "../../components/common/navbar/NavBar"
import CartList from "./childComps/CartList"
import CartBottomBar from "./childComps/CartBottomBar"

export default {
  name:'Cart',
  components:{
    NavBar,
    CartList,
    CartBottomBar,
  },
  computed:{
    cartLength(){
      return this.$store.state.cartList.length
    }
  }
}
</script>

<style scoped>
  .cart {
    height: 100vh;
  }
  .cart-nav-bar {
    background-color: var(--color-tint);
    color: #fff;
  }
</style>